/**
 * 统计数组中相等且可以被整除的数对
 * @USER: Administrator
 * @DATE: 2024/10/5 上午9:32
 * @VERSION: 1.0.0
 */
public class LC2176 {
    public static void main(String[] args) {

    }

    public int countPairs(int[] nums, int k) {
        int count = 0;
        for (int i = 0; i < nums.length; i++) {
            for (int j = i+1; j < nums.length; j++) {
                if (nums[i]==nums[j]&&i*j%k==0) {
                    count++;
                }
            }
        }
        return count;
    }
}
